package com.lnu.information.test;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 6:17 PM 2022/5/31
 * @modified By :
 */
public class S2Class extends DClass{
    String name;  //隐藏父类的姓名

    int sex = 1;//新增性别属性

    S2Class(String s,int i,int sexcode) //自己的构造器

    { super(s,i);
        this.name = s + "_sub";

        sex = sexcode;

    }

    public void show() //重写父类方法

    { super.show();//调用父类方法

        System.out.println("特别的名字："+this.name);

        if(sex == 1)     System.out.println("性别=男");

        else  System.out.println("性别=女");

    }

    public static void main(String[] args){

        S2Class d = new S2Class("张三",19510101,2);

        d.show();

    }
}
